package com.woniu.communitymanagement.util;



import java.sql.ResultSet;
import java.sql.SQLException;

public class demo1 extends BaseDAO {


    public static void main(String[] args) {
        for (int i = 1; i < 20; i++) {
            String sql="select password from userinfo where id="+i;
            BaseDAO dao =new BaseDAO();
            String password=null;
            try {
                ResultSet rs = dao.executeQuery(sql);
                if (rs.next()){
                    password =Md5.md5(rs.getString("password")) ;
                }
                rs.close();
                dao.closeAll();
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
            sql="update userinfo set password='"+password+"' where id="+i;
            int count = dao.executeUpdate(sql);
            System.out.println(count);

        }


    }


}
